<!DOCTYPE html>
<html>
    <head>
        <title>TODO supply a title</title>
        <meta charset="UTF-8">
        <link href="__PUBLIC__/js/themes/default/easy_ui.css" rel="stylesheet" type="text/css" />
        <link href="__PUBLIC__/js/themes/icon.css" rel="stylesheet" type="text/css" />
        <link href="__PUBLIC__/css/demo.css" rel="stylesheet" type="text/css" />
        <script src="__PUBLIC__/js/jquery-1.8.0.min.js" type="text/javascript"></script>
        <script src="__PUBLIC__/js/jquery.easyui.min.js" type="text/javascript"></script>
        <script>
            $(function(){
                loadData();
            });
            function loadData() {
                var param = {
                };
                $('#tbGrid').datagrid({
                    title: '在线反馈列表',
                    iconCls: 'icon-save',
                    width: '80%',
                    height: 'auto',
                    nowrap: false,
                    striped: true,
                    url: "{:U('CustomFeedback/getCustomFeedbackList')}",
                    queryParams: param,
                    columns: [[
                            {field: 'FeedbackContent', title: '反馈内容', width: 800, align: 'left',formatter: function(value, row, index){              
                                        var t="";
                                         if(row.FeedbackContent.length>50){
                                         t= row.FeedbackContent.substring(0,50)+"...";
                                        }
                                        else t=row.FeedbackContent;
                                       return  '<span class="easyui-tooltip" data-p1="'+index+'">'+t+'<span/>';
                            }},
                            {field: 'InsertTime', title: '反馈时间', width: 400, align: 'left'}
                        ]],
                     toolbar: [{
                            id: 'refresh',
                            text: '刷新',
                            iconCls: 'icon-reload',
                            handler: function() {
                                $('#tbGrid').datagrid("reload",{});
                            }
                     }],
                    onLoadSuccess: function(data) {
                        $('.easyui-tooltip').tooltip({position: 'right',
                            onShow: function() {
                                var index = parseInt($(this).attr('data-p1'));
                                var row = $('#tbGrid').datagrid('getRows')[index];
                                var content='<div style=" width: 300px; height:auto; font-style:  normal">'+row.FeedbackContent+'</div>';
                                $(this).tooltip('update', content);
                                //$(this).tooltip('tip').css({backgroundColor: '#666', borderColor: '#666'});
                            }});
                    }
                });
            }
        </script>
    </head>
    <body>
        <div  data-options="region:'center',title:'在线反馈列表'">
            <table class="easyui-datagrid" id="tbGrid" singleselect="true">  
            </table>
        </div>
    </body>
</html>
